package com.joysuch.wwyt.edu.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.joysuch.wwyt.common.entity.UserDataEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 *
 * </p>
 *
 * @author pp
 * @since 2021-04-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("wwyt_edu_certificate_user")
@ApiModel(value="EduCertificateUser对象", description="")
public class WwytEduCertificateUser extends UserDataEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "证书ID", required = true)
    @TableField(value = "CERT_ID",fill = FieldFill.INSERT_UPDATE)
    private Long certId;

    @ApiModelProperty(value = "人员ID", required = true)
    @TableField(value = "USER_ID",fill = FieldFill.INSERT_UPDATE)
    private Long userId;

    @ApiModelProperty(value = "取证日期")
    @TableField(value = "TAKEN_TIME",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private java.util.Date takenTime;

    @ApiModelProperty(value = "到期日期")
    @TableField(value = "OUT_OF_DATE_TIME",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private java.util.Date outOfDateTime;

    @ApiModelProperty(value = "证书编号",required = true)
    @TableField(value = "CERT_NO",fill = FieldFill.INSERT_UPDATE)
    @Length(max = 64, message = "证件编号不能超过64个字符")
    private String certNo;

    @ApiModelProperty(value = "人员/承包商人员flag 0: 人员; 1 承包商人员")
    private Boolean userContractorFlag;

    @ApiModelProperty(value = "外部链接URL")
    private String refUrl;

    @ApiModelProperty(value = "附件idJson")
    @TableField(value = "attachment_id_json",fill = FieldFill.INSERT_UPDATE)
    private String attachmentIdJson;

    @ApiModelProperty(value = "证书状态: 有效; 已过期")
    private String certStatus;

    @ApiModelProperty(value = "证书等级")
    @TableField(value = "CARTIFICATE_LEVEL",fill = FieldFill.INSERT_UPDATE)
    @Length(max = 64, message = "证件等级不能超过64个字符")
    private String cartificateLevel;

    @ApiModelProperty(value = "发证机关")
    @TableField(value = "LICENSE_ISSUING_AGENCIES",fill = FieldFill.INSERT_UPDATE)
    @Length(max = 64, message = "发证机关不能超过64个字符")
    private String licenseIssuingAgencies;

    @ApiModelProperty(value = "证书存放地")
    @TableField(value = "LICENSE_SAVING_AREA",fill = FieldFill.INSERT_UPDATE)
    @Length(max = 64, message = "证书存放地不能超过64个字符")
    private String licenseSavingArea;

    @ApiModelProperty(value = "持证状态: 0-草稿/1-归档/2-作废",required = true)
    @TableField(value = "CERTIFICATE_STATUS",fill = FieldFill.INSERT_UPDATE)
//    @NotNull(message = "请设置状态")
    private Integer certificateStatus;

    @ApiModelProperty(value = "备注")
    @TableField(value = "REMARK",fill = FieldFill.INSERT_UPDATE)
    @Length(max = 512, message = "备注不能超过512个字符")
    private String remark;

    @ApiModelProperty(value = "复证日期")
    @TableField(value = "REPEAT_VIEW_DATE_TIME",fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private java.util.Date repeatViewDateTime;


}
